from django.urls import path, re_path
from system.views.usersLogicDeal import login_logic,getUserInfoData,user_page,getUserData,userAdd_page,addUserData,userEdit_page,editUserData,delUserData,queryUserData
from system.views.deptLogicDeal import dept_page,getDeptDataTree,getDeptData,deptAdd_page,addDeptData,delDeptData,deptEdit_page,editDeptData
from system.views.menuLogicDeal import menu_page,getMenuData,menuAdd_page,addMenuData,menuEdit_page,editMenuData,delMenuData,listMenuButtonData
from system.views.roleLogicDeal import role_page,getRoleData,roleAdd_page,addRoleData,roleEdit_page,editRoleData,delRoleData,queryRoleData
from system.views.logLogicDeal import loginLog_page,operationLog_page,getLoginLogData,getOperationLogData
from django.contrib.auth.decorators import login_required
app_name='system'
urlpatterns = [
    # 显示页面的路由
    path('login/', login_logic, name='login'),
    path('deptPage/', login_required(dept_page), name='deptPage'),
    path('deptAddPage/', login_required(deptAdd_page), name='deptAddPage'),
    path('deptEditPage/', login_required(deptEdit_page), name='deptEditPage'),
    path('menuPage/', login_required(menu_page), name='menuPage'),
    path('menuAddPage/', login_required(menuAdd_page), name='menuAddPage'),
    path('menuEditPage/', login_required(menuEdit_page), name='menuEditPage'),
    path('rolePage/', login_required(role_page), name='rolePage'),
    path('roleAddPage/', login_required(roleAdd_page), name='roleAddPage'),
    path('roleEditPage/', login_required(roleEdit_page), name='roleEditPage'),
    path('userPage/', login_required(user_page), name='userPage'),
    path('userAddPage/', login_required(userAdd_page), name='userAddPage'),
    path('userEditPage/', login_required(userEdit_page), name='userEditPage'),
    path('loginLogPage/', login_required(loginLog_page), name='loginLogPage'),
    path('operationLogPage/', login_required(operationLog_page), name='operationLogPage'),
    # # 逻辑处理路由
    # 请求获得的路由数据
    path('getUserInfo/',getUserInfoData, name='getUserInfo'),
    path('getDeptDataTree/', getDeptDataTree, name='getDeptDataTree'),
    path('getDeptData/<int:id>',getDeptData, name='getDeptData'),
    path('addDeptData/', addDeptData, name='addDeptData'),  
    path('editDeptData/<int:id>', editDeptData, name='editDeptData'),
    path('editMenuData/<int:id>', editMenuData, name='editMenuData'),
    path('getMenuData/', getMenuData, name='getMenuData'),
    path('addMenuData/', addMenuData, name='addMenuData'),
    path('delDeptData/<int:id>', delDeptData, name='delDeptData'),
    path('delMenuData/<int:id>', delMenuData, name='delMenuData'),
    path('getRoleData/', getRoleData, name='getRoleData'),
    path('addRoleData/', addRoleData, name='addRoleData'),
    path('editRoleData/<int:id>', editRoleData, name='editRoleData'),
    path('delRoleData/<int:id>', delRoleData, name='delRoleData'),
    path('queryRoleData/', queryRoleData, name='queryRoleData'),
    path('getUserData/', getUserData, name='getUserData'),
    path('addUserData/', addUserData, name='addUserData'),
    path('editUserData/<int:id>', editUserData, name='editUserData'),
    path('delUserData/<int:id>', delUserData, name='delUserData'),
    path('queryUserData/', queryUserData, name='queryUserData'),
    path('getLoginLogData/', getLoginLogData, name='getLoginLogData'),
    path('getOperationLogData/', getOperationLogData, name='getOperationLogData'),
    path('listMenuButtonData/<str:key>',listMenuButtonData,name='listMenuButtonData')
    #path('downUserTemplate/', downUserTemplate, name='downUserTemplate'),
    # # templates
    
    # path('templates/', tem_page, name='templates'),
    # re_path(r'addTemPage/', temAdd_page, name='addTemPage'),
    # re_path(r'showTagPage/',showTag_page, name='showTagPage'),
    # path('tags/', tags_page, name='tags'),
    # # 查询数据
    # path('query_tag/',queryTag_data, name='queryTagData'),
    # # 查询数据
    # path('query_tem/',queryTem_data, name='queryTemData'),
    # path('add_tem/',addTem_data, name='addTemData'),
    # re_path(r'searchTemData/',searchTem_data, name='searchTemData'),
    
]
